//
//  CAIBehaviorAttack.h
//  beast_tamer
//
//  Created by  bk on 13/1/22.
//
//

#ifndef beast_tamer_CAIBehaviorAttack_h
#define beast_tamer_CAIBehaviorAttack_h

#include "CAIManager.h"
#include "CBaseAI.h"
#include "AIDef.h"
#include "CProcessFunctions.h"

using namespace MMA;
class CBattleObject;
class CAIBehaviorAttack : public CAIBehavior , public CProcessFunctions<CAIBehaviorAttack>
{
public:
    
    enum Fun
    {
        Move =0,
        Attack
    };
    
    enum
    {
        MonsterDistance = 1,
    };
    
    enum ATTACK_DISTANCE
    {
        ATTACK_DISTANCE_X = 25 ,
        
        ATTACK_DISTANCE_Y = 10,
    };
    
    enum
    {
        START_ATTACK_TIME = 2,
        //START_SEARCH_TIME = 1,
    };
    
    CAIBehaviorAttack();
    
    virtual ~CAIBehaviorAttack();
    
    virtual bool Init(CAIManager*);
    
    virtual void Entering(IStateInput*);
    
    virtual void Update(IStateInput*);
    
    virtual void Leaving(IStateInput*);
    
    virtual int ShouldChange(IStateInput*);
    
protected:
    
    //bool CheckMasterIsEnterLayer();
    
    void onProcessMove();
    
    void onProcessAttack();
    
    void onHandleDamage(void* Data);
    
private:
    
    
    CBattleObject* targetObject;
    
    bool           m_isStartTime;
    
    float          m_StartTime;
    
};

#endif
